﻿namespace SimpleInOutControl.InitDatabase
{
    internal class Program
    {
        static void Main(string[] args)
        {
            try
            {
                //ConnectionConfig connectionConfig = new ConnectionConfig()
                //{
                //    ConnectionString = "Server=localhost;Database=smartranchdb;User=root;Password=root;Port=3306;Charset=utf8;pooling=false;Allow User Variables=True;Convert Zero Datetime=True;",
                //    DbType = DbType.MySql,
                //    LanguageType = LanguageType.English,
                //    IsAutoCloseConnection = true,
                //};

                //using (SqlSugarClient client = new SqlSugarClient(connectionConfig))
                //{
                //    //根据数据库创建类文件
                //    //client.DbFirst.CreateClassFile("F:\\works\\smartranch\\SmartRanchApi\\YuHan.SmartRanch.DBModels", "YuHan.SmartRanch.DBModels");
                //    client.DbFirst.CreateClassFile("F:\\works\\smartranch\\SmartRanchApi\\YuHan.SmartRanch.Entities\\DBModels", "YuHan.SmartRanch.Models.DBModels");
                //}

                DataBaseHelper.CodeFirst();

                DataBaseHelper.InitData();
                Console.WriteLine("数据库创建完成");
            }
            catch (Exception ex)
            {
                Console.Write(ex);
            }
        }
    }
}
